<?php use_helper('Javascript') ?>
<?php $deudor = $form->getObject() ?>
<?php if($pathinfo == '/administracion/createdeudor' ): ?>
<?php echo form_remote_tag(array(
    'update'   	=> 'acciones_deudor',
    'url'      	=> 'administracion/updatedeudor'.(!$deudor->isNew() ? '?id='.$deudor->getId() : ''),
	'loading'	=> visual_effect('appear','loading'),
	'complete'	=> visual_effect('fade','loading').visual_effect('appear','ingresa-deudordomicilio'),
))?>
<?php else: ?>
<?php echo form_remote_tag(array(
    'update'   	=> 'acciones_deudor',
    'url'      	=> 'administracion/updatedeudor'.(!$deudor->isNew() ? '?id='.$deudor->getId() : ''),
	'loading'	=> visual_effect('appear','loading'),
	'complete'	=> visual_effect('fade','loading'),
))?>
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          <?php echo button_to_remote('Cancelar', array(
          		'update'	=> 'modulo',
          		'url'		=> 'administracion/indexdeudor',
          		'loading'	=> visual_effect('appear','loading', array('duration' => 0)),
				'complete'	=> visual_effect('fade','loading', array('duration' => 0)), )); ?>
          <input type="submit" value="Guardar" />
        </td>
      </tr>
      <tr><td><?php if($pathinfo == '/administracion/createdeudor' ){
      		}else{
      		echo button_to_remote('A&ntilde;adir Domicilio', array(
    		'update' => 'acciones_deudor',
    		'url'    => 'administracion/editdeudordomicilio?iddeudor='. $deudor->getId(),
			'loading'	=> visual_effect('appear','loading', array('duration' => 0)),
			'complete'	=> visual_effect('fade','loading', array('duration' => 0)),
			));} ?>
     	 </td>
      	<td><?php if($pathinfo == '/administracion/createdeudor' ){
      			}else{
      			echo button_to_remote('Editar Domicilios', array(
					'update'	=> 'list-search-deudordomicilio',
					'url'		=> 'administracion/searchdeudordomicilioupdate?accion=editardomicilio&iddeudor='.$deudor->getId(),
					'loading'	=> visual_effect('appear','loading'),
					'complete'	=> visual_effect('appear','list-search-deudordomicilio').
									visual_effect('highlight','list-search-deudordomicilio',array('duration' => 1.0)).
									visual_effect('fade','loading'),));} ?>
	 	 </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><label for="deudor_rut_deudor">Rut</label></th>
        <td>
          <?php echo $form['rut_deudor']->renderError() ?>
          <?php echo $form['rut_deudor'] ?>
        </td>
      </tr>
      <tr>
      <th><label for="deudor_nombres">Nombres</label></th>
        <td>
          <?php echo $form['nombres']->renderError() ?>
          <?php echo $form['nombres'] ?>
        </td>
      </tr>
      <tr>
        <th><label for="deudor_apellido_paterno">Apellido Paterno</label></th>
        <td>
          <?php echo $form['apellido_paterno']->renderError() ?>
          <?php echo $form['apellido_paterno'] ?>
        </td>
        <th><label for="deudor_apellido_materno">Apellido Materno</label></th>
        <td>
          <?php echo $form['apellido_materno']->renderError() ?>
          <?php echo $form['apellido_materno'] ?>
        </td>
      </tr>
      <tr>
        <th><label for="deudor_celular">Tel&eacute;fono Celular</label></th>
        <td>
          <?php echo $form['celular']->renderError() ?>
          <?php echo $form['celular'] ?>
        </td>
        <th><label for="deudor_email">Email</label></th>
        <td>
          <?php echo $form['email']->renderError() ?>
          <?php echo $form['email'] ?>

        <?php echo $form['id'] ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>
<div id="list-search-deudordomicilio" class="pop-up" style="display:none"></div>